
import RequestAndLoad from '../pages/request-and-load.vue';
import NotFoundPage from '../pages/404.vue';

import Tabs from '../pages/tabs/tabs'
import Login from '../pages/login'
import LuckySpin from '../pages/lucky-spin'
import RatPushProject from '../pages/rat-push-project'
import MyOrders from '../pages/my-order'
import OrdersList from '../pages/orders-list'
import LatestNews from '../pages/latest-news'
import ArticleDetails from '../pages/article-details'
import MutualTransfer from '../pages/mutual-transfer'
import TransferRecord from '../pages/transfer-record'
import ShareCenter from '../pages/share-center'
import MyTeam from '../pages/my-team'
import PositionList from '../pages/position-list'
import RevenueBreakdown from '../pages/revenue-breakdown'
import PaymentRecord from '../pages/payment-record'
import CollectionInformation from '../pages/collection-information'
import AddPayType from '../pages/add-pay-type'
import PerformanceInquiry from '../pages/performance-inquiry'
import CommunityPerformanceInquiry from '../pages/community-performance-inquiry'
import MyCustomerService from '../pages/my-customer-service'
import ServiceRecord from '../pages/service-record'
import ServiceChat from '../pages/service-chat'
import SecurityCenter from '../pages/security-center'
import UpdatePassword from '../pages/update-password'
import BindEmail from '../pages/bind-email'
import Setting from '../pages/settings'
import ForgetPwd from '../pages/forget-pwd'
import Register from '../pages/register'
import Active from '../pages/active'


var routes = [
  {
    path: '/',
    component: Tabs,
  },
  {
    path: '/login/',
    component: Login,
  },
  {
    path: '/lucky-spin/',
    component: LuckySpin,
  },
  {
    path: '/rat-push-project/',
    component: RatPushProject,
  },
  {
    path: '/my-orders/',
    component: MyOrders,
  },
  {
    path: '/orders-list/',
    component: OrdersList,
  },
  {
    path: '/latest-news/',
    component: LatestNews,
  },
  {
    path: '/article-details/',
    component: ArticleDetails,
  },
  {
    path: '/mutual-transfer/',
    component: MutualTransfer,
  },
  {
    path: '/transfer-record/',
    component: TransferRecord,
  },
  {
    path: '/share-center/',
    component: ShareCenter,
  },
  {
    path: '/my-team/',
    component: MyTeam,
  },
  {
    path: '/position-list/',
    component: PositionList,
  },
  {
    path: '/revenue-breakdown/',
    component: RevenueBreakdown,
  },
  {
    path: '/payment-record/',
    component: PaymentRecord,
  },
  {
    path: '/collection-information/',
    component: CollectionInformation,
  },
  {
    path: '/add-pay-type/',
    component: AddPayType,
  },
  {
    path: '/performance-inquiry/',
    component: PerformanceInquiry,
  },
  {
    path: '/community-performance-inquiry/',
    component: CommunityPerformanceInquiry,
  },
  {
    path: '/my-customer-service/',
    component: MyCustomerService,
  },
  {
    path: '/service-record/',
    component: ServiceRecord,
  },
  {
    path: '/service-chat/',
    component: ServiceChat,
  },
  {
    path: '/security-center/',
    component: SecurityCenter,
  },
  {
    path: '/update-password/',
    component: UpdatePassword,
  },
  {
    path: '/bind-email/',
    component: BindEmail,
  },
  {
    path: '/setting/',
    component: Setting,
  },
  {
    path: '/forget-pwd/',
    component: ForgetPwd,
  },
  {
    path: '/register/',
    component: Register,
  },
  {
    path: '/active/',
    component: Active,
  },


  {
    path: '/request-and-load/user/:userId/',
    async: function (routeTo, routeFrom, resolve, reject) {
      // Router instance
      var router = this;

      // App instance
      var app = router.app;

      // Show Preloader
      app.preloader.show();

      // User ID from request
      var userId = routeTo.params.userId;

      // Simulate Ajax Request
      setTimeout(function () {
        // We got user data from request
        var user = {
          firstName: 'Vladimir',
          lastName: 'Kharlampidi',
          about: 'Hello, i am creator of Framework7! Hope you like it!',
          links: [
            {
              title: 'Framework7 Website',
              url: 'http://framework7.io',
            },
            {
              title: 'Framework7 Forum',
              url: 'http://forum.framework7.io',
            },
          ]
        };
        // Hide Preloader
        app.preloader.hide();

        // Resolve route to load page
        resolve(
          {
            component: RequestAndLoad,
          },
          {
            context: {
              user: user,
            }
          }
        );
      }, 1000);
    },
  },
  {
    path: '(.*)',
    component: NotFoundPage,
  },
];

export default routes;
